<include file="Public:header" />
<!--主体内容-->
<!--左边-->
<div class="centent_box">
    <include file="Public:left" />
    <!--右边-->
    <div class="centent_right_box">
        <div class="centent_right rightCon">
            <div class="Mtitle">
                <ul>
                    <li class="on" onclick="swit (this, 'all')"><span>客源列表</span></li>
                    <li class="" onclick="swit (this, 'check')"><span>待审核列表</span></li>
                </ul>
            </div>
            <div class="table all">
                <table class="tab_list">
                    <tr>
                        <th style="width: 20%">录入时间</th>
                        <th style="width: 10%">客源名称</th>
                        <th style="width: 15%">联系电话</th>
                        <th style="width: 20%">需求类型</th>
                        <th style="width: 10%">浏览量</th>
                        <th style="width: 10%">状态</th>
                        <th style="width: 15%">操作</th>
                    </tr>
                    <volist name="a_list['list']" id='vo'>
                    <tr>
                        <td>{$vo.add_time|date='Y-m-d H:i:s',###}</td>
                        <td>{$vo.estate}</td>
                        <td><a href="{:urlShow('used',$vo['id'])}" target="_blank">{$vo.title}</a></td>
                        <td>{$vo.build}栋{$vo.fool}层{$vo.room}房</td>
                        <td>{$vo.hits}</td>
                        <td class="green">{$status[$vo['status']]}</td>
                        <td class="dn">
                            <a href="{:U('Examine/detail',array('id'=>$vo['id']))}">详情</a>
                        <td>
                    </tr>
                    </volist>
                </table>
                <div class="page">
                    {$a_list.page}
                </div>
            </div>
            <div class="table check table-hide">
                <table class="tab_list">
                    <tr>
                        <th style="width: 20%">发布时间</th>
                        <th style="width: 10%">所属小区</th>
                        <th style="width: 15%">房源名称</th>
                        <th style="width: 20%">房源地址</th>
                        <th style="width: 10%">浏览量</th>
                        <th style="width: 10%">状态</th>
                        <th style="width: 15%">操作</th>
                    </tr>
                    <volist name="c_list['list']" id='vo'>
                        <tr>
                            <td>{$vo.add_time|date='Y-m-d H:i:s',###}</td>
                            <td>{$vo.estate}</td>
                            <td><a href="{:urlShow('used',$vo['id'])}" target="_blank">{$vo.title}</a></td>
                            <td>{$vo.build}栋{$vo.fool}层{$vo.room}房</td>
                            <td>{$vo.hits}</td>
                            <td class="green">{$status[$vo['status']]}</td>
                            <td class="dn">
                                <a href="javascript:void(0)" onclick="exam ({$vo.id})">审核</a>
                            <td>
                        </tr>
                    </volist>
                </table>
                <div class="page">
                    {$c_list.page}
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function swit (tar, id){
        $(tar).addClass('on');
        $(tar).nextAll('li').removeClass('on');
        $(tar).prevAll('li').removeClass('on');
        $('.table').addClass('table-hide');
        $('.'+id).removeClass('table-hide');
    }
    function exam (id){
        layer.confirm('选择是否通过？', {
            btn: ['是','否'] //按钮
        }, function(){
            var url = "{:U('Ajax/examine')}";
            var data = {id:id};
            $.post (url, data, function (respose){
                if (respose.state == 'ok'){
                    layer.msg('房源已通过', {icon: 1});
                    location.reload(1);
                }else{
                    layer.msg('网络出错', {icon: 0});
                }
            },'json');
        }, function(){
            layer.msg('房源未通过', {icon: 0});
        });
    }
</script>
<include file="Public:footer" />